﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Verifications
{
    public interface IVerifior
    {

        /// <summary>
        /// 为空
        /// </summary>
        /// <returns></returns>
        IVerifior IsNullOrEmpty();

        /// <summary>
        /// 是否非空
        /// </summary>
        /// <returns></returns>
        IVerifior IsNotNullOrEmpty();



        /// <summary>
        /// 整数
        /// </summary>
        /// <returns></returns>
        IVerifior IsInt();

        /// <summary>
        /// 浮点数
        /// </summary>
        /// <returns></returns>
        IVerifior IsDouble();

        /// <summary>
        /// 完整日期
        /// </summary>
        /// <returns></returns>
        IVerifior IsDateTime();

        IVerifior IsShort();

        IVerifior IsLong();

        IVerifior IsDecimal();

        IVerifior IsFloat();



        IVerifior IsGreater(int value);
        IVerifior IsGreater(double value);
        IVerifior IsGreater(DateTime value);
        IVerifior IsGreater(short value);
        IVerifior IsGreater(long value);
        IVerifior IsGreater(decimal value);
        IVerifior IsGreater(float value);
        IVerifior IsGreater<T>(T value);



        IVerifior IsGreaterEqual(int value);
        IVerifior IsGreaterEqual(double value);
        IVerifior IsGreaterEqual(DateTime value);
        IVerifior IsGreaterEqual(short value);
        IVerifior IsGreaterEqual(long value);
        IVerifior IsGreaterEqual(decimal value);
        IVerifior IsGreaterEqual(float value);
        IVerifior IsGreaterEqual<T>(T value);



        IVerifior IsLess(int value);
        IVerifior IsLess(double value);
        IVerifior IsLess(DateTime value);
        IVerifior IsLess(short value);
        IVerifior IsLess(long value);
        IVerifior IsLess(decimal value);
        IVerifior IsLess(float value);
        IVerifior IsLess<T>(T value);



        IVerifior IsLessEqual(int value);
        IVerifior IsLessEqual(double value);
        IVerifior IsLessEqual(DateTime value);
        IVerifior IsLessEqual(short value);
        IVerifior IsLessEqual(long value);
        IVerifior IsLessEqual(decimal value);
        IVerifior IsLessEqual(float value);
        IVerifior IsLessEqual<T>(T value);

        IVerifior IsEqual(object value);
        IVerifior IsEqual(object value, bool ignoreCase);


        /// <summary>
        /// 中文字符
        /// </summary>
        /// <returns></returns>
        IVerifior IsChinese();


        /// <summary>
        /// 电子邮件
        /// </summary>
        /// <returns></returns> 
        IVerifior IsEmail();

        /// <summary>
        /// URL地址
        /// </summary>
        /// <returns></returns>
        IVerifior IsUrl();

        /// <summary>
        /// IP地址
        /// </summary>
        /// <returns></returns>
        IVerifior IsIP();

        /// <summary>
        /// 国内固定电话
        /// </summary>
        /// <returns></returns>
        IVerifior IsTel();

        /// <summary>
        /// 国内移动电话
        /// </summary>
        /// <returns></returns>
        IVerifior IsMobile();

        /// <summary>
        /// 邮政编码
        /// </summary>
        /// <returns></returns>
        IVerifior IsPostCode();

        /// <summary>
        /// QQ号码
        /// </summary>
        /// <returns></returns>
        IVerifior IsQQ();

        /// <summary>
        /// 国内身份证
        /// </summary>
        /// <returns></returns>
        IVerifior IsIDCard();



        /// <summary>
        /// 长度范围
        /// </summary>
        /// <returns></returns>
        IVerifior IsInLengthRange(int min, int max);
        /// <summary>
        /// 是否等于长度
        /// </summary>
        /// <param name="length"></param>
        /// <returns></returns>
        IVerifior IsLength(int length);

        /// <summary>
        /// 匹配正则
        /// </summary>
        /// <returns></returns>
        IVerifior IsMatchRegex(string regex);

        /// <summary>
        /// 验证结果
        /// </summary>
        bool Result();

        /// <summary>
        /// 带错误提示的判断
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Result(out string message);
    }
}
